package designprinciples.singleresponsibility;

/**
 * @program: MyTank
 * @description:
 * @author: 王术平
 * @create: 2021-01-23 18:20
 **/
public class Client02 {
    public static void main(String[] args) {
        Person02 me = new MeatLover();
        me.eat("张三");
        me.eat("李四");
        me.eat("王五");

        Person02 ve = new Vegetarian();
        ve.eat("爱迪生");
        ve.eat("达芬奇");
    }
}


//素食主义者
class Vegetarian implements Person02 {
    @Override
    public void eat(String name) {
        System.out.println(name + "吃肉");
    }
}

//素食主义者
class MeatLover implements Person02 {
    @Override
    public void eat(String name) {
        System.out.println(name + "吃素");
    }
}


interface Person02 {
    void eat(String name);
}